package org.gd.hellojson.gson;

import com.google.gson.Gson;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class GsonFromExample {

    public static void main(String[] args) {
        Gson gson = new Gson();
        try {

            BufferedReader br = new BufferedReader(new FileReader("file.json"));
            DataObject obj = gson.fromJson(br, DataObject.class);
            System.out.println(obj);

        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            System.exit(0);
        }
    }
}
